package guitforl.parsers.xml

import guitforl.parsers.xml.ImplementationXMLKeywords._
import guitforl.parsers.xml.TemplateXMLKeywords._
import xml.NodeSeq

/**
 * Created by IntelliJ IDEA.
 * User: artem
 * Date: Jul 14, 2010
 * Time: 12:39:41 AM
 * To change this template use File | Settings | File Templates.
 */

object XMLWidgetNodeParser{

	def getWidgetName(widgetNode: NodeSeq) = {
		(widgetNode \ NAME).text
	}

	def getDefaultValue(widgetNode: NodeSeq) = {
		(widgetNode \ DEFAULT_VALUE_NODE).text
	}

	def getWidetCaption(widgetNode: NodeSeq) = {
		(widgetNode \ ELEMENT_CAPTION).text
	}

	def getDataSourceFileNames(widgetNode: NodeSeq) = {
		(widgetNode \ ELEMENT_DATA_NODE).map(_.text)
	}

	def getEditParamName(editNode: NodeSeq) = {
		(editNode \ EDIT_PARAM_NAME).text
	}

	def getChartType(chartNode: NodeSeq) = {
		(chartNode \ CHART_TYPE).text.toInt
	}

	def getCompositeWidth(compositeNode: NodeSeq) = {
		(compositeNode \ WIDTH).text
	}

  def getCompositeHeight(compositeNode: NodeSeq) = {
		(compositeNode \ HEIGHT).text
	}

  def getXAxeCaption(chartNode:NodeSeq) = {
    (chartNode \ CHART_XAXE_CAPTION).text
  }

  def getYAxeCaption(chartNode:NodeSeq) = {
    (chartNode \ CHART_YAXE_CAPTION).text
  }
}